package objects;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

import extra.Position;



public class ImageObject {
	
	private Position position;
	private BufferedImage imageToShow;
	private BufferedImage collisionShape;
	
	
	public ImageObject(ImageObject im){
		this.position = new Position(im.getPosition().getX(),im.getPosition().getY());
		this.imageToShow = im.imageToShow;
		this.collisionShape=im.collisionShape;
		
	}
	
	public ImageObject(){
		position=new Position();
	}


	public Position getPosition() {
		return position;
	}


	public void setPosition(Position position) {
		this.position = position;
	}


	public BufferedImage getImageToShow() {
		return imageToShow;
	}


	public void setImageToShow(BufferedImage imageToShow) {
		this.imageToShow = imageToShow;
	}


	public BufferedImage getCollisionShape() {
		return collisionShape;
	}


	public void setCollisionShape(BufferedImage collisionShape) {
		this.collisionShape = collisionShape;
	}
	
	
	public void paint(Graphics g){
		
		g.drawImage(imageToShow, (int)position.getX(),(int) position.getY(), null);
		
	}
	
	
	public boolean isInside(int x, int y){
		if(x>position.getX() && y>position.getY() && x<position.getX()+collisionShape.getWidth() && y<position.getY()+collisionShape.getHeight()){
			return true;
		}
		return false;
	}
	
}
